package leetCode.solution;

public class Solution171 {

	public static void main(String[] args) {
		System.out.println(new Solution171().titleToNumber("AB"));
	}
	public int titleToNumber(String columnTitle) {
		int res = 0;
        char[] chars = columnTitle.toCharArray();
        for(char c : chars) {
            int temp = c - 'A' + 1;
            res = res * 26 + temp;
        }
        return res;
    }
}
